function numberOfVideos(videoSize, videoUnit, driveSize, driveUnit) {
  const videoUnitArr = ['KB', 'MB', 'GB'];
  const driveUnitArr = ['TB', 'GB'];
  if (!videoUnitArr.includes(videoUnit)) {
    return "Invalid video unit";
  }
  if (!driveUnitArr.includes(driveUnit)) {
    return "Invalid drive unit";
  }
  switch (videoUnit) {
    case "KB":
      videoSize *= 1e3;
      break;
    case "MB":
      videoSize *= 1e6;
      break;
    case "GB":
      videoSize *= 1e9;
      break;
  }
  switch (driveUnit) {
    case "KB":
      driveSize *= 1e3;
      break;
    case "MB":
      driveSize *= 1e6;
      break;
    case "GB":
      driveSize *= 1e9;
      break;
    case "TB":
      driveSize *= 1e12;
      break;
  }
  let num = Math.floor(driveSize / videoSize);
  return num;
}

console.log(numberOfVideos(500, "MB", 100, "GB"));
